<?php
class Mf_userModel {
	static $_table = 'mf_user';
	static $_pk = 'uid';
	static $_db = null;

	static function db(){
		if(self::$_db)
			return self::$_db;
		
		self::$_db = DbLib::getDbStatic('',self::$_table,self::$_pk);
		return self::$_db;
	}
	
	public static function __callStatic($func, $arguments){
		return call_user_func_array(array(self::db(),$func), $arguments);
	}
	public static function _getRow($userName){
		return self::db()->getRow("SELECT 1 FROM `mf_user` WHERE 1 AND `username` = '".$userName."' AND `is_del` = 'N' ");
	}
	public static function _add($data){
		return self::db()->add($data);
	}
	public static function _update($data,$table = '',$where){
		return self::db()->update($data,$table,$where);
	}
	public static function _getRowByUid($uid){
		return self::db()->getAll("SELECT * FROM `mf_user` WHERE `uid` = ".$uid);
	}
	public static function _getRowByUids($uids){
		return self::db()->getAll("SELECT * FROM `mf_user` WHERE `uid` IN ( ".$uids.")");
	}
}